<?php
if(!defined('InEmpireCMS'))
{
	exit();
}
$ptypeId=65;
$mid=10;
$page_load_js="../../../skin/default/editor/xheditor/xheditor-zh-cn.min.js?v=1.1.5";
?>
<?php
$url="<a href=../../../>首页</a>&nbsp;>&nbsp;<a href=../cp/>控制面板</a>";
require(ECMS_PATH.'e/data/template/cp_1.php');
?>

<script src="../data/html/setday.js"></script>
<script src="../../../skin/default/editor/xheditor/xheditor-zh-cn.min.js?v=1.1.5"></script>
<link href="../../../skin/default/editor/xheditor/skin/commons.css" rel="stylesheet" type="text/css" />

<div class="dmain_conent">
<style>
={color:#000;}
textarea{width:590px;height:120px;margin:5px 0px;}
#list{padding:10px 15px;borde11r:1px solid #000;}
#jingdianmiaoshu{width:590px;height:200px;}
#list table tr td .need_title{margin-left:-7px;color:red;padding:5px 2px;width:200px;}
.xheBtnAbout{display:none;}
input{margin:5px;}
.error-text{color:red;font-weight:bold;}
.error-text span{color:blue;padding:0px 10px;}
</style>
<div class="pageindex"><div class="tips active">添加活动</div></div>
<div class='dmini-content'>
<form action ="../../DoInfo/ecms.php" method="post" id="submit_frm"  enctype="multipart/form-data" style="display:none;">
	<input type="hidden" name="classid" value="<?=$ptypeId?>" />
	<input name="adduserid" type=hidden value="<?=$user[userid]?>"/>
	<input type=hidden value=MAddInfo name=enews> <input type=hidden value=<?=$ptypeId?> name=classid /> 
    <input name=id type=hidden id="id" value=> <input type=hidden value="1299387792" name=filepass> 
    <input name=mid type=hidden id="mid" value=<?=$mid?>/></td>

	<input type=hidden value="<?=time();?>" name=filepass /> 

<div id="list" style='padding:5px'>
<div style="height:300px;width:100%;">
</div>
</div>
<table width='100%'> 
<tr><td align='center'><input type="submit" style="padding:5px 25px; border:1px solid #000;background:#F5E58C;cursor:pointer;color:#000;font-weight:bold;" value="提交"/></td</tr>
</table>
</form>
</div>
<script>
var userInfo=<?=json_encode($userInfo);?>;

$().ready(function(){
$("#list").load("../../DoInfo/AddInfo.php?ajax_form_only=1&classid=65",function(){
	$("#submit_frm").show();
	$("#adduser").val(userInfo.nickname?userInfo.nickname:"");
	$("#tel").val(userInfo.phone?userInfo.phone:"");
	$('#jingdianmiaoshu').xheditor({tools:'Cut,Copy,Paste,Pastetext,|Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,SelectAll,Removeformat,|,Align,List,Outdent,Indent,|,Link,Unlink,Img,Flash,Media,Emot,Table,|,Source,Preview,Fullscreen'});

});
$("#submit_frm").submit(function(){
	var o=$(".need_title");
	$(".error-text").hide();
	for(var i=0;i<o.length;i++){
		if(i==1 && !$("input[name=active_coverfile]").val()){
				var inputO=$("input[name=active_coverfile]>.error-text");
				if(inputO.length){
					inputO.show();
				}else{
					$("input[name=active_coverfile]").parent().append("<div class='error-text'>请选择文件</div>");
					alert("请选择封面图片文件");
				}
				return false;
			}
		var	to=o.eq(i);
		var tvo=to.parent();
		var textNull=tvo.text();
		var vo=tvo.siblings("td").find("input,textarea");	
		if(vo.val()==""){
			//alert("不能为空");

			vo.trigger("focus");
			if(vo.siblings("div").length){
				vo.siblings("div").show();
			}else{
				vo.parent().append("<div class='error-text'><span>"+textNull+"</span>不能为空！</div>").show();
			}
			return false;
		}
	}

});
});
</script>

<?php
require(ECMS_PATH.'e/data/template/cp_2.php');
?>